#ifndef _IIC_H
#define _IIC_H

// 旧库，停止维护，不再使用，请使用i2c.h

#include <REGF51RC.H>

#define IIC_CMD 0  // 写命令
#define IIC_DATA 1 // 写数据
#define IIC_MODE 0

sbit IIC_SCL = P1 ^ 0;  // SCL
sbit IIC_SDA = P1 ^ 1; // SDA

#define IIC_SCLK_Clr() IIC_SCL = 0
#define IIC_SCLK_Set() IIC_SCL = 1

#define IIC_SDIN_Clr() IIC_SDA = 0
#define IIC_SDIN_Set() IIC_SDA = 1

void IIC_Start();
void IIC_Stop();
void Write_IIC_Command(unsigned char IIC_Command);
void Write_IIC_Data(unsigned char IIC_Data);
void Write_IIC_Byte(unsigned char IIC_Byte);
void IIC_Wait_Ack();
void IIC_WR_Byte(unsigned dat, unsigned cmd);

#endif
